#ifndef _QY_MUTEX_H
#define _QY_MUTEX_H

#include <pthread.h>
#include "Noncopyable.h"

namespace qy
{

class Mutex : public Noncopyable
{
public:
	static Mutex* create();
	static void destroy(Mutex *m);

	virtual ~Mutex();

	void lock();
	void unlock();
	bool trylock();

private:
	Mutex(pthread_mutex_t mutex_v);

private:
	pthread_mutex_t m_mutex;
	
};

}
#endif
